/** LuaInterface is a simple wrapper for the standard lua c++ interface I made to simplify things for me.
 * Default values:
 * int = 0;
 * float = 0;
 * string = "";
 */

#ifndef LUAINTERFACE_H
#define LUAINTERFACE_H

extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

#include <iostream>
#include <vector>
#include <set>

struct luaFunction{
  const char *name;
  lua_CFunction func;
};

class LuaInterface{
    public:
        void Init();

        bool LoadValues(std::string filename);
        void LoadScript(const char* filename);

        void PrepFunction(int ref);

        void AddArgument(int arg);
        void CallFunction();
        int GetFunctionReference(const char* function);

        void RegisterCallback(std::string name, int (*f)(...));

        std::string GetString(const char* var);
        std::vector<std::string> GetStringList(const char* var);
        std::set<std::string> GetStringSet(const char* var);
        int GetInt(const char* var);
        float GetFloat(const char* var);
        std::vector<float> GetFloatList(const char* var);

        void PushInt(int var);

    protected:
        lua_State* L;
//        vector<luaFunction> luaFunctions;
};

extern LuaInterface lua;

//class LIENoList:public Exception{
//    public:
//    protected:
//};

#endif
